home *** CD-ROM | disk | FTP | other *** search
Wrap
; ----------------------------------------------------- ; Peace and Protection (by misspai) ; ----------------------------------------------------- ; Wrappers for default IRC/mIRC ; commands (included for safety, ; functional enhancements, and ; quick-help purposes) ; ----------------------------------------------------- dns { if ($1 == $null) { dns | return } if (. !isin $1) { set %.to.dns $_nickglob($1) | .dns %.to.dns } else { set %.to.dns $1 | .dns $1 } if ($show) { set %_showdns %_showdns %.to.dns if (. isin $1) echo $colour(other) -si2 *** Looking up $+ $1 else echo $colour(other) -si2 *** Looking up host of $+ %.to.dns } } notify { if ($left($1,1) isin -+) { set %.opt $1 | set %.nick $_nickglob($2) | set %.note $3- } else { set %.opt - | set %.nick $_nickglob($1) | set %.note $2- } if (%.nick == $null) { notify | return } set %.addr $gettok(%.note,1,32) if ((@ isin %.addr) || (* isin %.addr) || ($left(%.addr,1) == $)) set %.note $gettok(%.note,2-,32) else unset %.addr if (s isin %.opt) { notify -s | return } if (h isin %.opt) { notify -h | return } if (d isin %.opt) { if ($address(%.nick,5) == $null) _lookup %.nick 3 notify $remove($remove(%.opt,d),a) %.nick , %.note set %.addr $_ppmask(%.nick,3) } elseif (i isin %.opt) { if (* isin %.addr) goto ok if ((! isin %.addr) && (@ isin %.addr)) set %.addr $gettok($_ppmask(%.addr,3),1,64) $+ @* elseif ($address(%.nick,5) == $null) _lookup %.nick 5 notify %.opt %.nick , %.note else set %.addr $gettok($_ppmask(%.nick,3),1,64) $+ @* } :ok if (v isin %.opt) set %.addr $gettok(%.addr,1,36) $+ $chr(36) $+ %pp.net if (w isin %.opt) set %.nick + $+ %.nick if (r isin %.opt) set %.dopt -r | else set %.dopt -a if (q isin %.opt) .notify %.dopt %.nick %.addr %.note else notify %.dopt %.nick %.addr %.note if (%+nickcolors) _nickcol %.nick $gettok($address(%.nick,5),2,64) $address(%.nick,5) } msg if ($2 == $null) _quickhelp /msg | msg $_nickseries(44,$1) $2- describe if ($2 == $null) _quickhelp /describe | describe $_nickseries(44,$1) $2- nick { if (%.+indns) return if ($1 == $null) _quickhelp /nick nick $1- if ($2 != $null) _dynpop.rot nick 8 $2 _dynpop.rot nick 8 $1 if (($me != $1) && (%pp.net != Offline)) { .timer903 off | .timer905 off | .timer906 off | .timer908 off | .timer909 off | .timer910 off | set %self.lag ?? } } ame if ($1 == $null) _quickhelp /ame | if ($chan(0) == 0) return | ame $1- amsg if ($1 == $null) _quickhelp /amsg | amsg $1- quit { if ($server == $null) _error You must be connected before you can quit. if ($1 == $null) _pentry quit $+ $_s2p($_finalmsg($replace($_getmsg(misc,quit),&online&,$duration($online)))) Quitting IRC- Enter quit message. if ($_vi(everyquit) >= 100) { unset %everyquit | quit Excess Pai } else { quit $1- _timersinc 2 -quithalt if (%-quithalt < 2) disps Quit message- $1- } } whois { if ($1 == $null) { if (($left($active,1) == @) || ($count($active,$chr(32)) > 0) || ($chan($active) == $active)) _error You must specify a nickname or use this command in a query or chat window. .enable #-whoisno | .raw whois $remove($active,=) } else { .enable #-whoisno set %.who $_nickseries(44,$_s2c($1-)) if ((%pp.net == undernet) && (($findtok(%.who,X,44) != $null) || ($findtok(%.who,W,44) != $null))) _error You should not use /whois on X or W $+ . (use /who if needed.) if ($1 == $2) { set %.who $_nickglob($1) | .raw whois %.who %.who } else .raw whois %.who } } w whois $1- who if ($1 == $null) _quickhelp /who | .enable #-whoisno | .raw who $1 $2- whowas if ($1 == $null) _quickhelp /whowas | .raw whowas $1- ww whowas $1- ew { if ($1 == $null) { if (($left($active,1) == @) || ($count($active,$chr(32)) > 0) || ($chan($active) == $active)) _error You must specify a nickname or use this command in a query or chat window. .enable #-whoisno | .raw whois $remove($active,=) $remove($active,=) } else { .enable #-whoisno if ((%pp.net == undernet) && (($1 == W) || ($1 == X))) _error You should not use /whois on X or W $+ . (use /who if needed.) set %.who $_nickglob($1) | .raw whois %.who %.who } } query { if ($1 == $null) _quickhelp /query set %.nnn $_nickglob($1) if ($2 == /me) { query %.nnn | _qc %.nnn ACTION $3- | echo $colour(own) -i2 %.nnn * $me $3- } else query %.nnn $2- set %.nnn $_renlogfile(%.nnn) set %.nnn2 $logdir $+ %.nnn if ($exists(%.nnn2)) _dynpop.rot log 8 %.nnn } q query $1- names { if ($1 == $null) { if ($chan($active) != $active) _error You must use this in a channel or specify a target channel. .raw names $active } elseif (* isin $1-) .raw names $1- else .raw names $_patch($1-) unset %-namec.* set %-namec.ppl 0 } invite { if ($2 != $null) { if ($_ischan($1)) invite $_nickglob($2) $1 else invite $_nickglob($1) $_patch($2) } elseif ($1 == $null) goto nope elseif (($chan($active) == $active) && ($_ischan($1) == $false)) invite $_nickglob($1) $active elseif (($query($active) == $active) && ($_ischan($1))) invite $active $1 elseif (($chat($remove($active,=)) == $remove($active,=)) && ($_ischan($1))) invite $remove($active,=) $1 else { :nope _error You must give a nickname and channel, or use in a channel and give a nick, or use in a query/chat and give a channel. } } inv invite $1- server { if ($1 == $null) _pentry server $+ $+ $_s2p(%lastconnect) Enter server to (re)connect to- if ((%pp.net != offline) && ($server != $null)) quit server hop if (($1 isnum) && ($len($1) == 4) && ($2 == $null)) { if ($server == $null) server $gettok(%lastconnect,1,32) $1 else server $server $1 } else server $1- } join if ($1 == $null) _quickhelp /join | .raw join $_patch($1) $2- j join $1- jp join $1- | ping $_patch($1) pj jp $1- part { if ($1 == $null) { if ($chan($active) != $active) _error You must use this in a channel or specify a target channel. set %.partmsg $_finalmsg($replace($_getmsg(misc,part),&chan&,$_patch($1))) .raw part $active : $+ %.partmsg } else { if (($_ischan($1)) || ($gettok($_patch($1),1,44) ischan)) { if ($2 == $null) set %.partmsg $_finalmsg($replace($_getmsg(misc,part),&chan&,$_patch($1))) else set %.partmsg $2- .raw part $_patch($1) : $+ %.partmsg } else { if ($chan($active) != $active) _error You must use this in a channel or specify a target channel. .raw part $active : $+ $1- } } } p part $1- notice { if ($2 == $null) _quickhelp /notice set %.mn.to $_nickseries(44,$1) if (, isin %.mn.to) { if ($_numtok(44,%.mn.to) < 6) set %.mn.send $_privn(Mass1,&targets&,%.mn.to,$2-) else set %.mn.send $_privn(Mass2,&targets&,$_numtok(44,%.mn.to),$2-) echo $colour(own) -ai2 -> %.mn.send } elseif ($_ischan(%.mn.to)) { set %.mn.send $_massmsg(Channel,$1,&ops&,$opnick(%.mn.to,0),$2-) if (%.mn.to ischan) echo $colour(own) -i2 $1 -> %.mn.to $+ %.mn.send else echo $colour(own) -ai2 -> %.mn.to $+ %.mn.send } else { set %.mn.send $_privn(Private,&nick&,%.mn.to,$_f2s($2-)) echo $colour(own) -ai2 -> %.mn.to $+ %.mn.send } _qnotice %.mn.to %.mn.send } n notice $1- chat { if ($1 == $null) { if ($query($active) == $active) _askyn _chatact DCC Chat with $active $+ ? dcc chat } else dcc chat $_nickglob($1) $2- } _chatact dcc chat $active c chat $1- send { if ($1 == $null) { if (($query($active) == $active) || ($chat($remove($active,=)) == $remove($active,=))) dcc send $remove($active,=) else dcc send } else dcc send $_nickglob($1) $2- } s send $1- motd set %-+motd.request $true | motd $1- ports .raw stats l ; ----------------------------------------------------- ; Color/talker identifiers- For ; internal use, but also for use by ; users if needed. ; ----------------------------------------------------- colori _pat.rand 02.03.04.05.06.07.09.10.12.13 $1- | return $result color2i _pat.rand 01.02.03.04.05.06.07.09.10.12.13.14.15 $1- | return $result funkyi _pat.rand 02.03.04.05.06.07.09.10.12.13.02.03.04.05.06.07.09.10.12.13.02.03.04.05.06.07.09.10.12.13 $1- | return $result pati _pattern $replace($gettok(21.22.18.10.19.23~0`17.15`14.14`15.1`16.14`15.15`14~5`17.4`17.7`17.8`17.7`17.4`17~1`24.8`17~8`21.8`22.8`18.8`10.8`19.8`23~...~18.10.19.25.15.25.19.10~1...~8/17.7/17.4/17.5/17.4/17.7/17~0`2-.0`12-.0`10-.0`11-.0`10-.0`12-,$1,126),`,$chr(44)) $2- | if ($1 == 4) return $+ $result | else return $result checkeri { set %.ch.pats 01-02-03-04-05-06-10-12-13-14,00-04-07-08-09-10-11-13-14-15,00-03-04-07-08-09-10-11-13-15,00-01-02-05-06-08-09-11-12-15,00-01-02-05-06-08-09-11-12-15,00-03-04-07-08-09-10-11-13-15,00-01-02-04-07-08-09-11-13-15,00-01-02-05-06-08-09-11-12-15,01-02-03-04-05-06-10-12-13-14,01-02-03-04-05-06-10-12-13-14,00-01-02-05-06-08-09-11-12-15,01-02-03-04-05-06-10-12-13-14,00-01-02-05-07-08-09-11-13-15,00-01-02-05-06-08-09-11-12-15,00-01-02-05-06-08-09-11-12-15,01-02-03-04-05-06-10-12-13-14 set %.ch.bk.a 0 $+ $r(0,15) set %.ch.bk.a $left(%.ch.bk.a,2) :bk.b set %.ch.bk.b 0 $+ $r(0,15) set %.ch.bk.b $left(%.ch.bk.b,2) if (%.ch.bk.b == %.ch.bk.a) goto bk.b set %.ch.fg.a $gettok($gettok(%.ch.pats,$_i(%.ch.bk.a),44),$r(1,10),45) :fg.b set %.ch.fg.b $gettok($gettok(%.ch.pats,$_i(%.ch.bk.b),44),$r(1,10),45) if (%.ch.fg.b == %.ch.fg.a) goto fg.b set %.ch.col $+ %.ch.fg.a $+ , $+ %.ch.bk.a $+ . $+ %.ch.fg.b $+ , $+ %.ch.bk.b _pattern %.ch.col $1- return $result } checker2i return $+ $checkeri($1-) $+ ulinei _pat.rand .$ $1- | if (2 // $count($result,)) return $result | return $result $+ boldi _pat.rand .$ $1- | if (2 // $count($result,)) return $result | return $result $+ codei _pat.rand ...$ $1- | unset %.cdi | if (2 \\ $count($result,)) set %.cdi %.cdi $+ | if (2 \\ $count($result,)) set %.cdi %.cdi $+ | return $result $+ %.cdi uvoweli return $replace($replace($replace($replace($replace($replace($lower($1-),a,A),e,E),i,I),o,O),u,U),y,Y) lvoweli return $replace($replace($replace($replace($replace($replace($upper($1-),A,a),E,e),I,i),O,o),U,u),Y,y) asciii { set %.ha.pats Aa└α┴ß┬Γ├π─Σ┼σ b▀ cCó╟⌐τ d╨≡ Ee╚Φ╔Θ╩Ω╦δ âF gG hH iI╠∞═φ╬ε╧∩í jJ kK Lúª mM N±╤ ╥≥╙≤╘⌠╒⌡╓÷╪°Oo p▐■╢ qQ «rR ºèÜs$ åT ┘∙┌█·√ⁿ▄╡Uu vV wW ╫X Ñ ƒy zZ set %.ha.str $lower($replace($1-,$chr(32),Å)) set %.ha.len $len(%.ha.str) set %.ha.pos 1 unset %.ha.fin :loop set %.ha.chr $mid(%.ha.str,%.ha.pos,1) if ($asc(%.ha.chr) isnum 97-122) { set %.ha.tok $gettok(%.ha.pats,$calc($asc(%.ha.chr) - 96),32) set %.ha.chr $mid(%.ha.tok,$r(1,$len(%.ha.tok)),1) } set %.ha.fin %.ha.fin $+ %.ha.chr if ($_vi(.ha.pos) <= %.ha.len) goto loop return $replace(%.ha.fin,Å,$chr(32)) } initcapi { set %.ic.num $_numtok(32,$1-) set %.ic.cur 1 | unset %.ic.ret :loop set %.ic.word $gettok($1-,%.ic.cur,32) set %.ic.ret %.ic.ret $upper($left(%.ic.word,1)) $+ $lower($_rchop(1,%.ic.word)) if ($_vi(.ic.cur) <= %.ic.num) goto loop return %.ic.ret } backwardsi { set %.bw.str $replace($1-,$chr(32),Å) set %.bw.len $len($1-) | unset %.bw.ret :loop set %.bw.ret %.bw.ret $+ $mid(%.bw.str,%.bw.len,1) if ($_vd(.bw.len) > 0) goto loop return $replace(%.bw.ret,Å,$chr(32)) } backwordsi { set %.bw.num $_numtok(32,$1-) unset %.bw.ret :loop set %.bw.ret %.bw.ret $gettok($1-,%.bw.num,32) if ($_vd(.bw.num) > 0) goto loop return %.bw.ret } randcapi { set %.rc.str $replace($1-,$chr(32),Å) set %.rc.len $len($1-) | set %.rc.cur 1 | unset %.rc.ret :loop if ($r(1,2) == 1) set %.rc.ret %.rc.ret $+ $upper($mid(%.rc.str,%.rc.cur,1)) else set %.rc.ret %.rc.ret $+ $lower($mid(%.rc.str,%.rc.cur,1)) if ($_vi(.rc.cur) <= %.rc.len) goto loop return $replace(%.rc.ret,Å,$chr(32)) } altcapi { set %.rc.str $replace($1-,$chr(32),Å) set %.rc.len $len($1-) | set %.rc.cur 1 | set %.rc.up $true unset %.rc.ret :loop if (%.rc.up) set %.rc.ret %.rc.ret $+ $upper($mid(%.rc.str,%.rc.cur,1)) else set %.rc.ret %.rc.ret $+ $lower($mid(%.rc.str,%.rc.cur,1)) set %.rc.up $_not(%.rc.up) if ($_vi(.rc.cur) <= %.rc.len) goto loop return $replace(%.rc.ret,Å,$chr(32)) } echoi { set %.ec.str $replace($2-,$chr(32),Å) set %.ec.len $len($2-) | set %.ec.cur 1 | unset %.ec.ret set %.ec.toks $_numtok(46,$1) :loop set %.ec.chr $mid(%.ec.str,%.ec.cur,1) set %.ec.tok 1 :loop2 set %.ec.ret %.ec.ret $+ $gettok($1,%.ec.tok,46) $+ %.ec.chr if ($_vi(.ec.tok) <= %.ec.toks) goto loop2 if ($_vi(.ec.cur) <= %.ec.len) goto loop return $replace(%.ec.ret,Å,$chr(32)) } fadei { set %.fd.toks $_numtok(46,$1) set %.fd.len $len($2-) set %.fd.str $replace($2-,$chr(32),Å) set %.fd.secl $int($calc(%.fd.len / %.fd.toks)) set %.fd.xtra $calc(%.fd.len % %.fd.toks) set %.fd.tok 1 unset %.fd.ret :loop set %.fd.ret %.fd.ret $+ $gettok($1,%.fd.tok,46) $+ $left(%.fd.str,%.fd.secl) set %.fd.str $_rchop(%.fd.secl,%.fd.str) if (%.fd.xtra > 0) { set %.fd.ret %.fd.ret $+ $left(%.fd.str,1) | set %.fd.str $_rchop(1,%.fd.str) | dec %.fd.xtra } if ($_vi(.fd.tok) <= %.fd.toks) goto loop return $replace(%.fd.ret,Å,$chr(32)) } randomi return $read -n $_adddir($1-) % return % [ $+ [ $1 ] ] ; ----------------------------------------------------- ; Setting and viewing channel ; modes and topics ; ----------------------------------------------------- mode { if ($1 == $me) umode $2- else { _psplit mm $replace($1-,+,) if ((%.mm.param != $null) && (%.mm.param != b) && (%.mm.param != b) && ($me !isop %.mm.chan)) _needops2 %.mm.chan change the mode .raw mode $replace(%.mm.chan,,+) $replace(%.mm.param,,+) if (k isin %.mm.param) .timer923 1 8 _chkkey $replace(%.mm.chan,,+) } } m mode $1- umode .raw mode $me $1- topic { _psplit tt $1- if (%.tt.param == $null) { .raw topic %.tt.chan | halt } elseif (t !isin $chan(%.tt.chan).mode) goto topicok _usexw %.tt.chan changethetopic topic if (%.xw != $null) { dispr %.tt.chan Using %col.target $+ %.xw $+ to change topic on %col.target $+ %.tt.chan $+ ... if (%.xw isin X.W) _privmsg %.xw topic %.tt.chan %.tt.param else _botcmd %.xw %.tt.chan $me %.tt.param } else { :topicok .raw topic %.tt.chan : $+ %.tt.param } } t topic $1- etopic _psplit tt $1- | set %_arhelp t %.tt.chan | _pentry _arhelp $+ $_s2p($chan(%.tt.chan).topic) New topic? mod m $1 +m dmod m $1 -m demod m $1 -m ; ----------------------------------------------------- ; Displaying P&P version ; ----------------------------------------------------- myver if (%pp.addon != $null) me is using %[ $+ Peace and Protection %pp.ver by misspai $+ %] with addons: %pp.addon | else me is using %[ $+ Peace and Protection %pp.ver by misspai $+ %] | me - If you want a copy, get it at http://pairc.com/pnp/ p&p myver ; ----------------------------------------------------- ; Patch support ; ----------------------------------------------------- patches patch patch { set %.fz.pver $remove($gettok(%pp.ver,1-2,46),v) window -c @Patches window -nl @Patches @Patches %font.basic _progress.1 Scanning $iif($1,$1 drive,all HDs) for P&P %pp.ver patches... _progress.2 0 0% complete... (drive $iif($1,$1,C:) $+ ) set %.fz.dr $iif($1,$asc($1),99) | unset %.fz.found :loop1 set %.fz.wh $chr(%.fz.dr) $+ :\ inc %.fz.found $findfile(%.fz.wh,*.ppp,@Patches) if (($1 == $null) && ($_vi(.fz.dr) <= 122)) { set %.fz.perc $int($calc((%.fz.dr - 99) * 100 / 24)) _progress.2 %.fz.perc %.fz.perc $+ % complete... (drive $upper($chr(%.fz.dr)) $+ :) goto loop1 } set %.fz.num $line(@Patches,0) if (%.fz.num > 0) { :loop2 set %.fz.ini $line(@Patches,%.fz.num) set %.fz.name $readini -n %.fz.ini info name set %.fz.ver $readini -n %.fz.ini info ver if ((%.fz.ver != %.fz.pver) || (%.fz.name == $null)) { dec %.fz.found | dline @Patches %.fz.num } else rline @Patches %.fz.num Patch: %col.dark $+ %.fz.name $+ $chr(160) ( $+ $shortfn(%.fz.ini) $+ ) if ($_vd(.fz.num) > 0) goto loop2 set %.fz.num $line(@Patches,0) } if (%.fz.num < 1) { window -c @Progress | window -c @Patches | _error No patch files found. } window -c @Progress iline @Patches 1 - Please double-click on the patch file you wish to install - iline @Patches 2 %col.att $+ WARNING: ONLY install patches you got from a verifiable source, such as the iline @Patches 3 Peace and Protection website. If you do not trust the source, do not install the patch! iline @Patches 4 $chr(160) set %.wz.hi $int($calc($_rtok(1,32,%font.basic) * 1.6 * (6 + %.fz.found))) if (%.wz.hi > $window(-3).h) %.wz.hi = $window(-3).h window -ar @Patches $_center($calc( [ $window(-3).w ] - 100),%.wz.hi) $calc( [ $window(-3).w ] - 100) %.wz.hi halt } _dopatch { if ($sline(@Patches,1).ln < 5) halt set %.patch $sline(@Patches,1) set %.file $_wrapfile($_lchop(1,$_rchop(1,$_rtok(1,32,%.patch)))) set %.name $gettok(%.patch,2-,32) set %.code $readini %.file info code if (%.code isin %pp.ver) _error This patch has already been installed. _progress.1 Installing patch: %.name _progress.2 0 Preparing patch-loader... window -n @Patches .timer900 off _timer924off .load -a pp300\a-patch.mrc _dopatch2 %.code %.file | halt } _pabort2 { .unload -a pp300\a-patch.mrc window -c @Progress _timer924on .timer900 0 1 _updtitle _gen-icf _error Patch aborted- $1- | halt } _pfinish { .unload -a pp300\a-patch.mrc _progress.2 100 Patch complete! _timer924on .timer900 0 1 _updtitle _gen-icf window -r @Patches | halt } _gen-icf { _writecfg Misc Integrity1 $alias(0) | _writecfg Misc Integrity2 $script(0) } ; ----------------------------------------------------- ; Addon support ; ----------------------------------------------------- addons addon addon { window -c @Addons window -l @Addons $_winpos(14%,7%,8%,8%) @Addons %font.basic set %.fz.num $findfile($mircdir,*.ppa,@Addons) if (%.fz.num > 0) { :loop2 set %.fz.ini $_wrapfile($line(@Addons,%.fz.num)) set %.fz.name $readini -n %.fz.ini addon name set %.fz.id $readini -n %.fz.ini addon id set %.fz.fn1 $readini -n %.fz.ini files 1 if ((%.fz.name == $null) || (%.fz.id == $null) || (%.fz.fn1 == $null) || ($findtok(%pp.addon.ids,%.fz.id,32) != $null)) dline @Addons %.fz.num else rline @Addons %.fz.num $chr(160) %col.att $+ + %col.dark $+ %.fz.name $+ $chr(160) ( $+ %.fz.ini $+ ) if ($_vd(.fz.num) > 0) goto loop2 set %.fz.num $line(@Addons,0) } iline @Addons 1 - Please double-click on the addon file you wish to install or uninstall - iline @Addons 2 %col.att $+ WARNING: Only install addons you got from a reliable source, such as the Peace and Protection website iline @Addons 3 or a reputable scripting site. Addons must be in the mIRC directory or a subdirectory to be found. iline @Addons 4 $chr(160) iline @Addons 5 Addon files- (double-click for info and to install) if (%.fz.num < 1) aline @Addons $chr(160) (no new addons found to install) aline @Addons $chr(160) aline @Addons Addons already installed- (double-click for info and options) set %.fz.num $_numtok(32,%pp.addon.ids) if (%.fz.num < 1) aline @Addons $chr(160) (no addons currently installed) else { :loop3 set %.fz.addon $gettok(%pp.addon.ids,%.fz.num,32) set %.fz.ini %addon. [ $+ [ %.fz.addon ] ] set %.fz.name $readini -n $_adddir(%.fz.ini) addon name if (%.fz.name != $null) aline @Addons $chr(160) %col.att $+ - %col.dark $+ %.fz.name $+ $chr(160) ( $+ $_adddir(%.fz.ini) $+ ) if ($_vd(.fz.num) > 0) goto loop3 } window -b @Addons } _doaddon { window -c @Addon set %.line $sline(@Addons,1) set %.type $strip($gettok(%.line,2,32)) if (%.type !isin -+) halt set %.file $_wrapfile($_lchop(1,$_rchop(1,$_rtok(1,32,%.line)))) window -l $_tabscale(6) @Addon $_winpos(15%,8%,9%,9%) @Addon %font.basic if (%.type == -) { titlebar @Addon options ( $+ %.file $+ ) aline @Addon - Double-click here to configure addon - aline @Addon - Double-click here for help on addon - aline @Addon - Double-click here to uninstall addon - } else { set %.ppver $readini -n %.file addon ppver set %.fz.pver $remove($gettok(%pp.ver,1-2,46),v) if (%.ppver > %.fz.pver) { window -c @Addon | _error This addon requires P&P version %.ppver or later (you have %.fz.pver $+ ) } titlebar @Addon installation ( $+ %.file $+ ) aline @Addon - Double-click here to install addon - } aline @Addon $chr(160) set %.name $readini -n %.file addon name set %.author $readini -n %.file addon author set %.ver $readini -n %.file addon version set %.url $readini -n %.file addon url set %.email $readini -n %.file addon email aline @Addon Name: $+ %col.info1 $+ %.name if (%.ver != $null) aline @Addon Version: $+ %col.info1 $+ %.ver if (%.author != $null) aline @Addon Author: $+ %col.info1 $+ %.author if (%.email != $null) aline @Addon E-Mail: $+ %col.info1 $+ %.email if (%.url != $null) aline @Addon URL: $+ %col.info1 $+ %.url set %.notes $readini -n %.file notes 1 if (%.notes != $null) { aline @Addon $chr(160) aline @Addon Notes aline @Addon %.notes set %.num 2 :loop2 set %.notes $readini -n %.file notes %.num if (%.notes != $null) { aline @Addon %.notes | inc %.num | goto loop2 } } aline @Addon $chr(160) aline @Addon Files set %.num 1 :loop3 set %.notes $readini -n %.file files %.num if (%.notes != $null) { aline @Addon %.notes | inc %.num | goto loop3 } halt } _doaddon2 { if ($sline(@Addon,1).ln > 3) halt set %.opt $strip($gettok($sline(@Addon,1),5,32)) set %.file $_wrapfile($_lchop(1,$_rchop(1,$gettok($window(@Addon).titlebar,2,32)))) if (%.opt == Install) { unset %.pcurr _progress.1 Installing addon... _progress.2 0 Loading addon files... set %.num 1 :loop1 set %.fn $readini -n %.file files %.num if (%.fn == $null) goto nextpart1 set %.fn2 $findfile($nofile(%.file),%.fn,1) if (%.fn2 == $null) { window -c @Progress | _error File " $+ %.fn $+ " not found (required for installation) } .load -rs %.fn2 inc %.num goto loop1 :nextpart1 _da3prog | .unload -rs pp300\r-misc.mrc _da3prog | .unload -rs pp300\r-flood.mrc _da3prog | .unload -rs pp300\r-reply.mrc _da3prog | .unload -rs pp300\r-disp.mrc _da3prog | .unload -rs pp300\r-whois.mrc _da3prog | .unload -rs pp300\a-fkeys.mrc _da4prog | .load -rs $_ppdir $+ r-misc.mrc _da4prog | .load -rs $_ppdir $+ r-disp.mrc _da4prog | .load -rs $_ppdir $+ r-flood.mrc _da4prog | .load -rs $_ppdir $+ r-reply.mrc _da4prog | .load -rs $_ppdir $+ r-whois.mrc _da4prog | .load -rs $_ppdir $+ a-fkeys.mrc _da2prog Updating integrity files... _gen-icf _progress.2 100 Install complete! set %.id $readini -n %.file addon id set %addon. [ $+ [ %.id ] ] $remove(%.file,$mircdir) set %pp.addon.ids %pp.addon.ids %.id set %.code $readini -n %.file addon code if (%.code != $null) set %pp.addon %pp.addon %.code set %.config $readini -n %.file addon config window -c @Progress window -c @Addon if ($_isopen(@Addons)) addon if (%.config != $null) %.config } elseif (%.opt == Configure) { set %.config $readini -n %.file addon config if (%.config == $null) _error This addon does not have any configuration. else %.config } elseif (%.opt == Help) { set %.config $readini -n %.file addon help if (%.config == $null) _error This addon does not have any defined help. else %.config } elseif (%.opt == Uninstall) { _progress.1 Uninstalling addon... _progress.2 0 Performing addon cleanup... set %.unload $readini -n %.file addon unload set %.unset $readini -n %.file addon vars set %.unini $readini -n %.file addon ini if (%.unload != $null) %.unload if (%.unset != $null) { set %.unset $_rchop(1,%.unset) [ unset % $+ [ %.unset ] ] } if (%.unini != $null) _remcfg %.unini _progress.2 25 Unloading addon files... set %.num 1 :loop2 set %.fn $readini -n %.file files %.num if (%.fn == $null) goto nextpart2 .unload -rs $script(%.fn) inc %.num | goto loop2 :nextpart2 _progress.2 50 Updating integrity files... _gen-icf _progress.2 75 Updating addon info... set %.id $readini -n %.file addon id set %addon. [ $+ [ %.id ] ] set %pp.addon.ids $remtok(%pp.addon.ids,%.id,32) set %.code $readini -n %.file addon code if (%.code != $null) set %pp.addon $remtok(%pp.addon,%.code,32) _progress.2 100 Uninstall complete! window -c @Addon if ($_isopen(@Addons)) addon .timer 1 10 _gen-icf } } _da4prog _da2prog Reloading P&P scripts in proper order... _da3prog _da2prog Unloading P&P scripts... _da2prog inc %.pcurr | set %.perc $int($calc(%.pcurr * 100 / 14)) | _progress.2 %.perc $1- ; ----------------------------------------------------- ; General editor/edit commands ; ----------------------------------------------------- edit { if ((. isin $1) || (\ isin $1) || (" isin $1)) { run $_ppcfg(Misc,TextView) $1- | .timer 1 10 _recfile2 $_adddir($1-) } elseif ($1 == $null) run $_ppcfg(Misc,TextView) elseif (p isin $1) protedit $2- elseif (c isin $1) config $2- elseif (b isin $1) blackedit $2- elseif (u isin $1) useredit $2- elseif (n isin $1) { run notepad $2- | .timer 1 10 _recfile2 $_adddir($2-) } elseif (w isin $1) { run wordpad $2- | .timer 1 10 _recfile2 $_adddir($2-) } elseif (l isin $1) viewlog $2- elseif ((r isin $1) || (g isin $1)) rec e else { run $_ppcfg(Misc,TextView) $1- | if ($1 != $null) .timer 1 10 _recfile2 $_adddir($1-) } } vlog viewlog $1- viewlog { if ($1 == $null) set %.aeris $gettok($active,1,32) | else set %.aeris $_nickglob($1) if ($left(%.aeris,1) isin =@) set %.aeris $_rchop(1,%.aeris) set %.aeris $_renlogfile(%.aeris) edit $logdir $+ %.aeris } dellog { if ($1 == $null) set %.aeris $gettok($active,1,32) | else set %.aeris $_nickglob($1) if ($left(%.aeris,1) isin =@) set %.aeris $_rchop(1,%.aeris) set %.aeris $_renlogfile(%.aeris) remove $logdir $+ %.aeris } savelog { if (($chr(32) isin $active) || (@ isin $active)) _error This command is meant only for channels or private chat windows set %.aeris $active if ($left(%.aeris,1) == =) set %.aeris $_rchop(1,%.aeris) set %.aeris $logdir $+ $_renlogfile(%.aeris) savebuf -a $active %.aeris | log on | dispa Buffer saved and logging initiated at $fulldate } rec { if (e isin $1) set %.cmd edit elseif (p isin $1) set %.cmd sound else set %.cmd run set %.file $_ppcfg(Gets,$_ppcfg(Gets,Num)) if (%.file == $null) _error No file received to run! %.cmd %.file $2- } recent rec $1- got rec $1- pp run peacepro.hlp | _recfile2 $_mircdir $+ peacepro.hlp notes set %.notefile notes.txt | if ($_not($exists(%.notefile))) { write %.notefile Notes | write %.notefile ----- } | edit notes.txt | _recfile2 %.notefile help { if ($1 == !) winhelp peacepro.hlp $2- else { set %.topic $readini [ [ $_ppdir ] $+ ] helps.ini help $remove($1,/) if (%.topic == c) winhelp peacepro.hlp $remove($1,/) command elseif (%.topic != $null) winhelp peacepro.hlp $remove($1,/) else help $remove($1-,/) } } ziplog _askyn _ziplog Make a .zip of all log files? _ziplog { set %.zipper $_ppcfg(misc,winzip) if (%.zipper == $null) _error Location of WinZip not defined in CONFIG.INI. Type /findzip to locate WinZip. if ($_not($exists(%.zipper))) _error WinZip has moved or been deleted. Type /findzip to locate WinZip. set %.ln $findfile($logdir,*.log,1) if (%.ln == $null) _error No log files found to WinZip run %.zipper $logdir $+ *.log } tome if ($window(@Whois) != $null) window -ar @Whois | else { open @Whois | window -r @Whois } auth { if ($1 == $null) _quickhelp /auth set %.a.nick $_nickglob($1) if (%.a.nick == $me) _error Don't add yourself to the userlist, it's unneeded and will only cause problems. if (($_ismask($1) == $false) && ($address(%.a.nick,5) == $null)) _lookup %.a.nick ! auth , $2- if (* isin $1) set %.a.addr $1 else { if (@ !isin %.a.nick) set %.a.nick $address(%.a.nick,5) set %.a.addr $maddress(%.a.nick) if (%.a.addr == $null) set %.a.addr $_ppmask(%.a.nick,3) } lvl %.a.addr +send -q | lvl %.a.addr +chat -q if ($2 == $null) set %.a.time 5 | else set %.a.time $2 dispa %col.target $+ %.a.addr $+ has authorization to send you files and DCC chat you for the next $+ %.a.time $+ minutes. .timerDauth [ $+ [ $replace($replace(%.a.addr,*,&),?,+) ] ] 1 $calc(%.a.time * 60) _unauth %.a.addr } _unauth lvl $1 -send -q | lvl $1 -chat -q | disps Authorization for files and DCC chats from %col.target $+ $1 $+ has expired.